package com.example.demo.controller;

import com.example.demo.properties.Page;
import com.example.demo.service.HttpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by chenbo on 2018/5/24.
 */
@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private Page page;

    @GetMapping(value = "/say")
    public String say(
            @RequestParam(value = "id",required = false, defaultValue = "0" )
            int id
    ){
        HttpService httpService = new HttpService ();
        String res = httpService.httpGet ( String.valueOf ( id ) );
        return "msg:"+ res;
    }

}
